<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="甘忠祥">
    <title>分期</title>
    <style>


        ul{
            margin: 0;
            padding: 0;
            list-style: none;
            margin-left: 500px;
        }
        ul li{
            float: left;
            padding: 0 20px;
            margin: 0 5px;
            border: 1px solid black;
            height: 50px;
            line-height: 50px;
            position: relative;
            cursor: pointer;
        }
        .baitiao{
            display: inline-block;
            width: 100px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            border: 1px solid black;
            background-color: lightgreen; 
        }
        div{
            position: absolute;
            left: 0;
            width: 280px;
            height: 30px;
            border: 1px solid black;
            background-color: lightgoldenrodyellow;
            line-height: 30px;
        }
        .red{
            border: 1px solid red;
        }
        .blue{
            border: 2px dotted blue;
        }
    </style>
</head>

<body>
        <ul>
            <li>不分期
                <div>无手续费</div>
            </li>
            <li>￥2364.27x3期
                <div>含手续费：费率0.5%，￥34.94×3期</div>
            </li>
            <li>￥1199.61x6期
                <div>含手续费：费率0.5%，￥34.94×6期</div>
            </li>
            <li>￥617.27x12期
                <div>含手续费：费率0.5%，￥34.94×6期</div>
            </li>
            <li>￥326.11x24期
                <div>含手续费：费率0.5%，￥34.94×6期</div>
            </li>
        </ul>
        <span class="baitiao">打白条</span>
</body>
<script src="./jquery.min.js"></script>
<script>
    $('div').hide();
    $('.baitiao').hide();
    $('ul li').hover(function(){
        $('ul li').eq($(this).index()).addClass('red');
        $('div').eq($(this).index()).show();
    },function(){
        $('ul li').eq($(this).index()).removeClass('red')
        $('div').eq($(this).index()).hide();
    });
    $('ul li').click(function(){
        // $('ul li').eq($(this).index()).addClass('blue').siblings().removeClass('blue')
        $(this).toggleClass('blue').siblings().removeClass('blue');
        if($(this).hasClass('blue')){
             $('.baitiao').show();
        }else{
            $('.baitiao').hide();
        }

    });

</script>
</html>